import os
from  .video import generate_video


def generate_dataset(path):
    """

    :param path:  目录
    :return:
    """
    for c_root, c_dirs, c_files in os.walk(path):
        for file in c_files:
            # 获取文件路径

            temp = file.split("-")
            print(os.path.join(c_root, temp[0] + "-" + temp[1] + "r-" + temp[2]))
            generate_video(os.path.join(c_root, file), os.path.join(c_root, temp[0] + "-" + temp[1] + "r-" + temp[2]),
                           os.path.join(c_root + "_reverse_face_generation", file), reverse=True)
    print("all finished")


if __name__ == "__main__":
    generate_dataset(r"D:\dataset\YawDDdataset\Mirror\Female_mirror")
    generate_dataset(r"D:\dataset\YawDDdataset\Mirror\Male_mirror")
